﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DispatchAssist.Weather.Interfaces;

namespace DispatchAssist.Weather.Entities
{
    [Serializable]
    class WeatherData
    {
        public WeatherData()
        {
            Airports = new List<IAirportLocation>();
            Providers = new List<IWeatherMapProvider>();
        }

        public IList<IAirportLocation> Airports { get; set; }
        public IList<IWeatherMapProvider> Providers { get; set; }

        public IWeatherMapProvider GetMapProvider(Guid mapProviderID)
        {
            return Providers.FirstOrDefault(o => o.WeatherProvideID == mapProviderID) ?? (Providers.Count > 0 ? Providers[0] : null);
        }
    }
}
